package com.xoa.dev.workFlow.controller;

import com.xoa.dev.workFlow.service.WorkFlowSelectUserService;
import com.xoa.model.users.Users;
import com.xoa.util.AjaxJson;
import com.xoa.util.CookiesUtil;
import com.xoa.util.common.session.SessionUtils;
import com.xoa.util.page.PageParams;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@Controller
@RequestMapping("WFSelectUser")
public class WorkFlowSelectUserController {

    @Autowired
    WorkFlowSelectUserService workFlowSelectUserService;

    @RequestMapping("/getWFUserGroup")
    @ResponseBody
    public AjaxJson getWFUserGroup(HttpServletRequest request, Integer flowId, Integer flowPrcs,Integer type,
                                   Integer deptId, Integer userPriv, String deptNo, String search, PageParams pageParams){
        Cookie redisSessionCookie = CookiesUtil.getCookieByName(request, "redisSessionId");
        Users user = SessionUtils.getSessionInfo(request.getSession(), Users.class, new Users(), redisSessionCookie);
        return workFlowSelectUserService.getWFUserGroup(request,flowId,flowPrcs,user,type,deptId,userPriv,deptNo,search,pageParams);

}




}
